# Maintainer: Fabian Bornschein <fabiscafe-at-mailbox-dot-org>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=evolution-ews
pkgver=3.50.1
pkgrel=1
pkgdesc="MS Exchange integration through Exchange Web Services"
url="https://wiki.gnome.org/Apps/Evolution/EWS"
arch=(loong64 x86_64)
license=(LGPL2.1)
depends=(
  evolution
  libmspack
)
makedepends=(
  cmake
  git
  intltool
  ninja
  python
  systemd
)
_commit=1df65d23109dc07130ba17ae96d67574390708eb  # tags/3.50.1^0
source=("git+https://gitlab.gnome.org/GNOME/evolution-ews.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  local cmake_options=(
    -DCMAKE_INSTALL_PREFIX=/usr
    -DLIBEXEC_INSTALL_DIR=/usr/lib
    -DSYSCONF_INSTALL_DIR=/etc
  )

  cmake -S $pkgname -B build -G Ninja "${cmake_options[@]}"
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}

# vim:set sw=2 sts=-1 et:
